#include <stdio.h>

// 宏定义标志位
#define ONE   0x01    // 0000 0001(1<<0)
#define TWO   0x02    // 0000 0010(1<<1)
#define THREE 0x04    // 0000 0100(1<<2)
#define FOUR 0x08    // 0000 1000(1<<3)


// 函数定义，检查并打印标志位
void func(int flags) {
    if (flags & ONE)    printf("flags has ONE! ");
    if (flags & TWO)    printf("flags has TWO! ");
    if (flags & THREE)  printf("flags has THREE! ");
    if (flags & FOUR)  printf("flags has FOUR! ");
    printf("\n");
}

int main() {
    // 调用函数，传递不同的标志位组合
    func(ONE);           // 仅传递 ONE
    func(THREE);         // 仅传递 THREE
    func(ONE | TWO);     // 同时传递 ONE 和 TWO
    func(ONE | THREE | TWO); // 同时传递 ONE、TWO 和 THREE
    return 0;
}

